



<div class="searchbox">
    <div class="searchbox_box">
        <div  class="searchbox_text"> 开始时间：</div>
        <div  class="searchbox_input"> <input type="text" class="datapick datapick1"   name="date1"> </div>
    </div>

    <div class="searchbox_box">
        <div  class="searchbox_text"> 结束时间：</div>
        <div  class="searchbox_input"><input type="text"   name="date2" class="datapick datapick2" > </div>
    </div>

  <!--  <div class="searchbox_box">
        <div  class="searchbox_text"> 商铺名：</div>
        <div  class="searchbox_input"><input type="text" > </div>
    </div>

    <div class="searchbox_box">
        <div  class="searchbox_text"> 订单号：</div>
        <div  class="searchbox_input"><input type="text" > </div>
    </div>-->

    <div class="searchbox_box">
        <div class="search_button am-btn am-btn-secondary "> <img src="<?php echo base_url();?>/public/assets/image/chazhao.png">查询 </div>
    </div>
   <!-- <div class="searchbox_box">
        <div class="search_button am-btn am-btn-secondary "><img src="<?php /*echo base_url();*/?>/public/assets/image/daochu.png">导出数据 </div>
    </div>-->

</div>
<div class="fbneirong">
        <table class="am-table  am-table-radius am-table-striped am-table-hover">
            <thead>
            <tr class="am-success">
                <th class="table-check" ><input type="checkbox" /></th>
                <th class="table-id">编号</th>
                <th class="table-title">主商品</th>
                <th class="table-type">单量</th>
                <th class="table-type">数量</th>
                <th class="table-type">SKU</th>
                <th class=" ">本金</th>
                <th class="">金币</th>
                <th class="table-title2">关键词</th>
                <th width="80px" class="table-set">任务状态</th>
                <th  class="table-title">操作</th>
            </tr>
            </thead>
            <tbody class="impowdith">
            </tbody>
        </table>

        <div id="Pagination" style="margin:20px auto" style="display:none">
        </div>




</div>



<!-- 底部模板-->
</div>
</div>
</div>

<div class="foods">
    <ul>
        版权所有@2019.
    </ul>
    <dl>
        <a href="" title="返回头部" class="am-icon-btn am-icon-arrow-up"></a>
    </dl>
</div>
</body>
</html>
<!-- 底部模板-->
<script>
    laydate.render({
        elem: '.datapick1'
    });
    laydate.render({
        elem: '.datapick2'
    });

    var base_url="<?php echo base_url();?>";
    var on_request=false;
    var type=1;
    var page=1;
    var epage=10;

    function setlisthtnml(data) {
        var html="";
        /*  <a class="am-btn am-btn-default am-btn-xs am-text-success am-round am-icon-file" data-am-modal="{target: '#my-popups'}" title="添加子栏目"></a>*/
        if(data.list.length>0){
            $.each(data.list, function (key, value) {
                html=html+
                    '<tr  class="mytr"  taskid="'+value.id+'" >' +
                    '<td class="table-check mytd"><input type="checkbox" /></td>\n'+
                    '<td class="mytd" >'+value.id+'</td>\n'+
                    '<td class="mytd"><div style="width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">'+value.goods_name+'</div></td>\n'+
                    '<td class="mytd">'+value.number+'</td>\n'+
                    '<td class="mytd">'+value.each_single+'</td>\n'+
                    '<td class="mytd"><div style="width:200px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">'+value.sku+'</div></td>\n'+

                    '<td class="mytd">'+value.money+'</td>\n'+
                    '<td class="mytd">'+value.gold+'</td>\n'+
                    '<td class="mytd"><div style="width: 250px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">'+value.keyword+'</div></td>\n'+
                    '<td class="mytd">'+value.status+'</td>\n'+
                    '<td class="mytd">'+
                    ''+
                    '<div class="tbody_action">'+
                    '<div><a href="'+base_url+'business/viewjdtask/'+value.id+'">查看任务</a></div>'+
                    '<div><a   class="green" href="'+base_url+'business/order_list/'+value.id+'">子任务列表</a></div>'+
                    '<div ><a  class="red"  href="'+base_url+'business/relodjdtask/'+value.id+'">重新发布</a></div></div>'+

                    ''+
                    '</td></tr>';
            });
            $(".impowdith").html(html);
            $('#Pagination').show();
            $(".pageeapge").change(function () {
                epage=$(this).val();

            });
        }else{
            html += '<div style="width:100%;text-align:center;">暂无数据</div>';
            $(".impowdith").html(html);
            $('#Pagination').hide();
        }


    }





    $(".search_button").click(function () {
        gettasklist();
    });


    gettasklist();
    function gettasklist() {
        var url = "<?php echo base_url(); ?>/Business/GetJdTaskList";
        var date1=$("input[name='date1']").val();
        var date2=$("input[name='date2']").val();
        var postdata = {
            'page': page,
            'date1': date1,
            'date2': date2,
            'epage': 10
        };
        layer.msg("数据加载中", {
            icon: 16, //代表加载的图标
            time: 3,  //0秒关闭（如果不配置，默认是3秒）
            shade: 0.5    });
        $.post(url, postdata, function (data) {
            window.layer.closeAll();
            on_request = false;
            setlisthtnml(data);
            setPagination("Pagination", data.count, page, data.epage, function (clickPage){
                page = parseInt(clickPage) + 1;
                gettasklist();
            });
        },'json');

    }





</script>